home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Macintosh Tracker 1.20 / source / Server⁄Tracker 4.0 / song.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-01  |  3.1 KB  |  144 lines  |  [TEXT/KAHL]

  1. /* song.h */
  2.  
  3. /* internal data structures for the soundtracker player routine....
  4.  */
  5.  
  6. /* $Id: song.h,v 4.0 1994/01/11 17:55:59 espie Exp espie $
  7.  * $Log: song.h,v $
  8.  * Revision 4.0  1994/01/11  17:55:59  espie
  9.  * REAL_MAX_PITCH for better player.
  10.  *
  11.  * Revision 1.3  1994/01/05  14:54:09  Espie
  12.  * *** empty log message ***
  13.  *
  14.  * Revision 1.2  1993/12/28  13:54:44  Espie
  15.  * REAL_MAX_PITCH != MAX_PITCH.
  16.  *
  17.  * Revision 1.1  1993/12/26  00:55:53  Espie
  18.  * Initial revision
  19.  *
  20.  * Revision 3.5  1993/12/02  15:45:33  espie
  21.  * Added samples_start.
  22.  *
  23.  * Revision 3.4  1993/11/17  15:31:16  espie
  24.  * *** empty log message ***
  25.  *
  26.  * Revision 3.1  1992/11/19  20:44:47  espie
  27.  * Protracker commands.
  28.  *
  29.  * Revision 3.0  1992/11/18  16:08:05  espie
  30.  * New release.
  31.  *
  32.  * Revision 2.5  1992/10/31  11:18:00  espie
  33.  * New fields for optimized resampling.
  34.  * Exchanged __ANSI__ to SIGNED #define.
  35.  */
  36.  
  37. #ifdef SIGNED
  38. typedef signed char SAMPLE;
  39. #else
  40. typedef char SAMPLE;
  41. #endif
  42.  
  43. #define NUMBER_SAMPLES 32
  44.  
  45. #define BLOCK_LENGTH 64
  46. #define NUMBER_TRACKS 4
  47. #define NUMBER_PATTERNS 128
  48.  
  49. #define NUMBER_EFFECTS 40
  50.  
  51. /* some effects names */
  52. #define EFF_ARPEGGIO    0
  53. #define EFF_DOWN        1
  54. #define EFF_UP          2
  55. #define EFF_PORTA       3
  56. #define EFF_VIBRATO     4
  57. #define EFF_PORTASLIDE  5
  58. #define EFF_VIBSLIDE    6
  59. #define EFF_OFFSET      9
  60. #define EFF_VOLSLIDE    10
  61. #define EFF_FF          11
  62. #define EFF_VOLUME      12
  63. #define EFF_SKIP        13
  64. #define EFF_EXTENDED    14
  65. #define EFF_SPEED       15
  66. #define EFF_NONE        16
  67. #define EXT_BASE        16
  68. #define EFF_SMOOTH_UP   (EXT_BASE + 1)
  69. #define EFF_SMOOTH_DOWN (EXT_BASE + 2)
  70. #define EFF_CHG_FTUNE   (EXT_BASE + 5)
  71. #define EFF_LOOP        (EXT_BASE + 6)
  72. #define EFF_RETRIG      (EXT_BASE + 9)
  73. #define EFF_S_UPVOL     (EXT_BASE + 10)
  74. #define EFF_S_DOWNVOL   (EXT_BASE + 11)
  75. #define EFF_NOTECUT     (EXT_BASE + 12)
  76. #define EFF_LATESTART   (EXT_BASE + 13)
  77. #define EFF_DELAY       (EXT_BASE + 14)
  78.  
  79. #define SAMPLENAME_MAXLENGTH 22
  80. #define TITLE_MAXLENGTH 20
  81.  
  82. #define MIN_PITCH 113
  83. #define MAX_PITCH 856
  84. #define REAL_MAX_PITCH 1050
  85.  
  86. #define MIN_VOLUME 0
  87. #define MAX_VOLUME 64
  88.  
  89. /* the fuzz in note pitch */
  90. #define FUZZ 2
  91.  
  92. /* we refuse to allocate more than 500000 bytes for one sample */
  93. #define MAX_SAMPLE_LENGTH 500000
  94.  
  95. struct sample_info
  96.    {
  97.    char *name;
  98.    int  length, rp_offset, rp_length;
  99.    unsigned long  fix_length, fix_rp_length;
  100.    int volume;
  101.    int finetune;
  102.    SAMPLE *start, *rp_start;
  103.    };
  104.  
  105. /* the actual parameters may be split in two halves occasionnally */
  106.  
  107. #define LOW(para) ((para) & 15)
  108. #define HI(para) ((para) >> 4)
  109.  
  110. struct event
  111.    {
  112.    unsigned char sample_number;
  113.    unsigned char effect;
  114.    unsigned char parameters;
  115.    unsigned char note;
  116.    int pitch;
  117.    };
  118.  
  119. struct block
  120.    {
  121.    struct event e[NUMBER_TRACKS][BLOCK_LENGTH];
  122.    };
  123.     
  124.         
  125. struct song_info
  126.    {
  127.    int length;
  128.    int maxpat;
  129.    int transpose;
  130.    char patnumber[NUMBER_PATTERNS];
  131.    struct block *pblocks;
  132.    };
  133.  
  134. struct song
  135.    {
  136.    char *title;
  137.       /* sample 0 is always a dummy sample */
  138.    struct sample_info samples[NUMBER_SAMPLES];
  139.    struct song_info info;
  140.    long samples_start;
  141.    };
  142.  
  143. #define AMIGA_CLOCKFREQ 3575872
  144.